package com.itheima.controller;

import com.itheima.factory.BeanFactory;
import com.itheima.service.ProductService;
import com.itheima.service.RoleService;
import com.itheima.service.UserService;

public class UserController {
    public static void main(String[] args) {
        // 测试抽取的工厂类
        UserService userService =(UserService) BeanFactory.getBean("userService");
        userService.findAll();
        //获取的BeanVal的值是com.itheima.service.impl.RoleServiceImpl
        //实现类的全限定类名
        RoleService roleService = (RoleService) BeanFactory.getBean("roleService");
        roleService.say();
        //实现类的全限定类名
        ProductService productService = (ProductService) BeanFactory.getBean("productService");
        productService.speak();
    }
}
